package com.opencloud.iot.provider.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.opencloud.common.model.PageParams;
import com.opencloud.common.model.ResultBody;
import com.opencloud.iot.client.model.entity.IotWatchinfo;
import com.opencloud.iot.provider.service.IotWatchinfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 物联设备（手环）信息
 * @author yeyong
 */
@RestController
@Api(value = "物联网设备", tags = "物联网设备（手环）信息查看")
public class IotWatchinfoController {
    @Autowired
    private IotWatchinfoService iotWatchinfoService;

    /**
     * 获取手表状态分页信息
     * @param map
     * @return
     */
    @ApiOperation(value = "获取手表状态分页信息", notes = "获取手表状态分页信息")
    @GetMapping("/watch/infos")
    public ResultBody<IPage<IotWatchinfo>> getWatchInfoListPage(@RequestParam(required = false) Map map){
        return ResultBody.ok().data(iotWatchinfoService.findListPage(new PageParams(map)));
    }
}
